package LuoGu.暴力.临时抱佛脚;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int ans = 0;
        int a = s.nextInt();
        int b = s.nextInt();
        int c = s.nextInt();
        int d = s.nextInt();
        int ala = 0;
        int alb = 0;
        int alc = 0;
        int ald = 0;
        Integer [] aa = new Integer [a+1];
        Integer [] bb = new Integer [b+1];
        Integer [] cc = new Integer [c+1];
        Integer [] dd = new Integer [d+1];
        for(int i=1;i<=a;i++){
            aa[i] = s.nextInt();
            ala += aa[i];
        }
        for(int i=1;i<=b;i++){
            bb[i] = s.nextInt();
            alb += bb[i];
        }
        for(int i=1;i<=c;i++){
            cc[i] = s.nextInt();
            alc += cc[i];
        }
        for(int i=1;i<=d;i++){
            dd[i] = s.nextInt();
            ald += dd[i];
        }
        if(a==1) ans+=aa[1];
        else{
            Arrays.sort(aa, new Comparator<Integer>() {
                @Override
                public int compare(Integer o1, Integer o2) {
                    if(o2>=o1) return 1;
                    else return 0;
                }
            });
            for(int i=1;i<=a;i++){
                aa[i]+=aa[i-1];
                if(aa[i]>=aa[a+1]-aa[i]){
                    ans+=aa[i];
                    break;
                }
            }
        }
        if(b==1) ans+=bb[1];
        else{
            Arrays.sort(bb);
            for(int i=1;i<=b;i++){
                bb[i]+=bb[i-1];
                if(bb[i]>=bb[b+1]-bb[i]){
                    ans+=bb[i];
                    break;
                }
            }
        }
        if(c==1) ans+=cc[1];
        else{
            Arrays.sort(cc);
            for(int i=1;i<=c;i++){
                cc[i]+=cc[i-1];
                if(cc[i]>=cc[c+1]-cc[i]){
                    ans+=cc[i];
                    break;
                }
            }
        }
        if(d==1) ans+=dd[1];
        else{
            Arrays.sort(dd);
            for(int i=1;i<=d;i++){
                dd[i]+=dd[i-1];
                if(dd[i]>=dd[d+1]-dd[i]){
                    ans+=dd[i];
                    break;
                }
            }
        }
        System.out.print(ans);
    }
}
